<?php
class AccountWS_Model_Account extends Ext_Db_Table
{
	protected $_name = "ac_account";
	protected $_primary = "account_id";
	protected $_sequence = 'ac_account_id_seq';

    public function getAccount( $sourceObjectId, $sourceObjectCode ) {
        $sql = $this->select()
        ->where( "locked = ?", 'F')
        ->where( "end_date is null" )
        ->where( "source_object_id = ?", $sourceObjectId )
        ->where( "source_object_code = ?", $sourceObjectCode );
        return $this->fetchRow( $sql );
    }
}
